package com.dingchw.singlemusic.define.response;

import lombok.Getter;

import java.io.Serializable;

@Getter
public class ResponseData<T> implements Serializable {
    private Boolean status;
    private T data;
    private String message;
    private Integer code;

    public ResponseData(ResponseStatusEnum statusEnum) {
        this.status = false;
        this.code = statusEnum.getCode();
        this.message = statusEnum.getMessage();
    }

    public ResponseData(ResponseStatusEnum statusEnum, String message) {
        this.status = false;
        this.code = statusEnum.getCode();
        this.message = message;
    }

    public ResponseData(T data) {
        ResponseStatusEnum responseStatusEnum = ResponseStatusEnum.SUCCESS;
        this.status = true;
        this.data = data;
        this.message = responseStatusEnum.getMessage();
        this.code = responseStatusEnum.getCode();
    }
}
